﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.RobotJog.Controls.CUiRJJointsOptionsForm
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;
using Tecnomatix.Engineering.Ui.WPF;


namespace DnProcessSimulateCommands.RobotJog.Controls;

public class CUiRJJointsOptionsForm : TxWindow, IComponentConnector
{
  private const string COLUMN_VERSION = "03";
  private const int GRID_CHECK_COL = 0;
  private const int GRID_TEXT_COL = 1;
  private int _selectedRow;
  private const string PRISMATIC_STEP_SIZE = "PrismaticStepSize";
  private const string REVOLUTE_STEP_SIZE = "RevoluteStepSize";
  private const string CUSTOM_SLIDER_SENSITIVITY_VALUE = "CustomSliderSensitivityValue";
  public const string COPY_ATTACHMENT = "CopyAttachmentValue";
  public const string DISPLAY_GHOST_GUN = "DisplayGhostGun";
  private const Decimal MAX_DECIMAL_MM = 7922815251426430000M;
  private const double PRISMATIC_STEP_SIZE_MIN_MM = 0.01;
  private const double REVOLUTE_STEP_SIZE_MIN_RAD = 0.00017453292519943296;
  private const double PRISMATIC_STEP_SIZE_MAX_MM = 7.92281525142643E+18;
  private const double REVOLUTE_STEP_SIZE_MAX_RAD = 12.566370614533705;
  internal Grid gridColumns;
  internal Button buttonUp;
  internal System.Windows.Controls.Image btnUp_img;
  internal Button buttonDown;
  internal System.Windows.Controls.Image btnDown_img;
  internal Label prismaticJointsStepSizeUnits;
  internal Label revoluteJointsStepSizeUnits;
  internal TxNumericEditBoxControl numericUpDownPrismaticStepSize;
  internal TxNumericEditBoxControl numericUpDownRevoluteStepSize;
  internal Slider sliderSensitivity;
  internal CheckBox copyAttachmentCheckBox;
  internal CheckBox displayGhostGunCheckBox;
  internal CheckBox manipulateSeamRoboticLocationsCheckBox;
  internal CheckBox ignoreSeamOperationLocationLimitationsCheckBox;
  internal CheckBox manipulateWeldRoboticLocationsCheckBox;
  internal CheckBox ignoreWeldOperationLocationLimitationsCheckBox;
  internal Button btnAccept;
  internal Button btnCancel;
  private bool _contentLoaded;

  public CUiRJJointsOptionsForm()
  {
    this.InitializeComponent();
    if (TxApplication.PlatformType == 3)
    {
      this.manipulateWeldRoboticLocationsCheckBox.Visibility = Visibility.Collapsed;
      this.ignoreWeldOperationLocationLimitationsCheckBox.Visibility = Visibility.Collapsed;
    }
    this.btnUp_img.Source = TxImageManager.GetImageByKey("ArrowUp").ConvertTo<ImageSource>(new System.Drawing.Size());
    this.btnDown_img.Source = TxImageManager.GetImageByKey("ArrowDown").ConvertTo<ImageSource>(new System.Drawing.Size());
  }

  public List<CUiRJJointsColumnData> Columns { get; set; }

  public double PrismaticStepSize { get; protected set; }

  public double RevoluteStepSize { get; protected set; }

  public int CustomSliderSensitivity { get; protected set; }

  public bool CopyAttachment
  {
    get
    {
      bool? isChecked = this.copyAttachmentCheckBox.IsChecked;
      bool flag = true;
      return isChecked.GetValueOrDefault() == flag & isChecked.HasValue;
    }
    protected set => this.copyAttachmentCheckBox.IsChecked = new bool?(value);
  }

  public bool DisplayGhostGun
  {
    get
    {
      bool? isChecked = this.displayGhostGunCheckBox.IsChecked;
      bool flag = true;
      return isChecked.GetValueOrDefault() == flag & isChecked.HasValue;
    }
    protected set => this.displayGhostGunCheckBox.IsChecked = new bool?(value);
  }

  public bool ManipulateSeamRoboticLocations
  {
    get
    {
      bool? isChecked = this.manipulateSeamRoboticLocationsCheckBox.IsChecked;
      bool flag = true;
      return isChecked.GetValueOrDefault() == flag & isChecked.HasValue;
    }
    protected set => this.manipulateSeamRoboticLocationsCheckBox.IsChecked = new bool?(value);
  }

  public bool IgnoreSeamOperationLocationLimitations
  {
    get
    {
      bool? isChecked = this.ignoreSeamOperationLocationLimitationsCheckBox.IsChecked;
      bool flag = true;
      return isChecked.GetValueOrDefault() == flag & isChecked.HasValue;
    }
    protected set
    {
      this.ignoreSeamOperationLocationLimitationsCheckBox.IsChecked = new bool?(value);
    }
  }

  public bool ManipulateWeldRoboticLocations
  {
    get
    {
      bool? isChecked = this.manipulateWeldRoboticLocationsCheckBox.IsChecked;
      bool flag = true;
      return isChecked.GetValueOrDefault() == flag & isChecked.HasValue;
    }
    protected set => this.manipulateWeldRoboticLocationsCheckBox.IsChecked = new bool?(value);
  }

  public bool IgnoreWeldOperationLocationLimitations
  {
    get
    {
      bool? isChecked = this.ignoreWeldOperationLocationLimitationsCheckBox.IsChecked;
      bool flag = true;
      return isChecked.GetValueOrDefault() == flag & isChecked.HasValue;
    }
    protected set
    {
      this.ignoreWeldOperationLocationLimitationsCheckBox.IsChecked = new bool?(value);
    }
  }

  public void RedrawGrid()
  {
    int num = 0;
    foreach (CUiRJJointsColumnData column in this.Columns)
    {
      SolidColorBrush resource = ((FrameworkElement) this).Resources[(object) "TableBorderBrush"] as SolidColorBrush;
      RowDefinitionCollection rowDefinitions = this.gridColumns.RowDefinitions;
      RowDefinition rowDefinition = new RowDefinition();
      rowDefinition.Height = new GridLength(20.0, GridUnitType.Pixel);
      rowDefinition.Name = column.ColumnName;
      rowDefinitions.Add(rowDefinition);
      CheckBox checkBox1 = new CheckBox();
      checkBox1.IsChecked = new bool?(column.Visible);
      checkBox1.VerticalAlignment = VerticalAlignment.Center;
      checkBox1.HorizontalAlignment = HorizontalAlignment.Center;
      CheckBox checkBox2 = checkBox1;
      Border border1 = new Border();
      border1.BorderBrush = (System.Windows.Media.Brush) resource;
      border1.BorderThickness = new Thickness(0.0, 0.0, 0.0, 1.0);
      border1.Child = (UIElement) checkBox2;
      Border element1 = border1;
      Grid.SetRow((UIElement) element1, num);
      Grid.SetColumn((UIElement) element1, 0);
      element1.GotFocus += new RoutedEventHandler(this.OnRowFocus);
      this.gridColumns.Children.Add((UIElement) element1);
      TextBox textBox1 = new TextBox();
      textBox1.Text = column.ColumnCaption;
      textBox1.Background = (System.Windows.Media.Brush) System.Windows.Media.Brushes.Transparent;
      textBox1.Margin = new Thickness(0.0, -1.0, -1.0, 0.0);
      textBox1.BorderThickness = new Thickness(0.0);
      textBox1.IsReadOnly = true;
      textBox1.SelectionBrush = (System.Windows.Media.Brush) System.Windows.Media.Brushes.Transparent;
      TextBox textBox2 = textBox1;
      textBox2.MouseDoubleClick += new MouseButtonEventHandler(this.textBox_MouseDoubleClick);
      Border border2 = new Border();
      border2.BorderBrush = (System.Windows.Media.Brush) resource;
      border2.BorderThickness = new Thickness(0.0, 0.0, 1.0, 1.0);
      border2.Child = (UIElement) textBox2;
      Border element2 = border2;
      element2.GotFocus += new RoutedEventHandler(this.OnRowFocus);
      Grid.SetRow((UIElement) element2, num++);
      Grid.SetColumn((UIElement) element2, 1);
      this.gridColumns.Children.Add((UIElement) element2);
    }
    if (this.gridColumns.RowDefinitions.Count <= 0)
      return;
    this.OnRowFocus((object) this.gridColumns.GetChild(0, 0, typeof (UIElement)), (RoutedEventArgs) null);
  }

  public bool ShowDialog(List<CUiRJJointsColumnData> columns)
  {
    this.Columns = columns;
    this.numericUpDownRevoluteStepSize.ValueType = (TxNumericEditValueType) 1;
    this.numericUpDownRevoluteStepSize.StepSize = 1.0;
    this.numericUpDownPrismaticStepSize.ValueType = (TxNumericEditValueType) 0;
    this.numericUpDownPrismaticStepSize.LowerBound = 0.01;
    this.numericUpDownPrismaticStepSize.UpperBound = 7.92281525142643E+18;
    this.numericUpDownRevoluteStepSize.LowerBound = 0.00017453292519943296;
    this.numericUpDownRevoluteStepSize.UpperBound = 4.0 * Math.PI;
    double? prismaticStepSizeValue;
    double? revoluteStepSizeValue;
    int? sliderSensitivityValue;
    bool? copyAttachmentValue;
    bool? displayGhostGunValue;
    this.LoadOptionsData(out prismaticStepSizeValue, out revoluteStepSizeValue, out sliderSensitivityValue, out copyAttachmentValue, out displayGhostGunValue);
    if (prismaticStepSizeValue.HasValue && revoluteStepSizeValue.HasValue && sliderSensitivityValue.HasValue)
    {
      this.numericUpDownPrismaticStepSize.Value = prismaticStepSizeValue.Value;
      this.numericUpDownRevoluteStepSize.Value = revoluteStepSizeValue.Value;
      this.sliderSensitivity.Value = (double) sliderSensitivityValue.Value;
      this.PrismaticStepSize = prismaticStepSizeValue.Value;
      this.RevoluteStepSize = revoluteStepSizeValue.Value;
      this.CustomSliderSensitivity = sliderSensitivityValue.Value;
    }
    else
    {
      this.numericUpDownPrismaticStepSize.Value = 1.0;
      this.numericUpDownRevoluteStepSize.Value = Math.PI / 180.0;
    }
    this.numericUpDownPrismaticStepSize.TextAlign = TextAlignment.Left;
    this.numericUpDownRevoluteStepSize.TextAlign = TextAlignment.Left;
    this.prismaticJointsStepSizeUnits.Content = (object) TxApplication.Options.Units.LinearUnitName;
    this.revoluteJointsStepSizeUnits.Content = (object) TxApplication.Options.Units.AngularUnitName;
    this.CopyAttachment = copyAttachmentValue.Value;
    this.DisplayGhostGun = displayGhostGunValue.Value;
    this.ManipulateSeamRoboticLocations = CApRJRobotJogUtilities.IsSeamLocationManipulationEnabled;
    this.IgnoreSeamOperationLocationLimitations = CApRJRobotJogUtilities.IgnoreSeamOperationLocationLimitations;
    this.ManipulateWeldRoboticLocations = CApRJRobotJogUtilities.IsWeldLocationManipulationEnabled;
    this.IgnoreWeldOperationLocationLimitations = CApRJRobotJogUtilities.IgnoreWeldOperationLocationLimitations;
    if (!this.ManipulateSeamRoboticLocations)
      this.DisableIgnoreSeamOperationLocationLimitationsCheckBox();
    if (!this.ManipulateWeldRoboticLocations)
      this.DisableIgnoreWeldOperationLocationLimitationsCheckBox();
    bool? nullable = ((Window) this).ShowDialog();
    bool flag = true;
    return nullable.GetValueOrDefault() == flag & nullable.HasValue;
  }

  public void LoadOptionsData(
    out double? prismaticStepSizeValue,
    out double? revoluteStepSizeValue,
    out int? sliderSensitivityValue,
    out bool? copyAttachmentValue,
    out bool? displayGhostGunValue)
  {
    this.LoadOptionsData(out prismaticStepSizeValue, out revoluteStepSizeValue, out sliderSensitivityValue);
    object obj1;
    TxWindowSettings.RestoreWindowValue((TxWindow) this, "CopyAttachmentValue", ref obj1);
    object obj2;
    TxWindowSettings.RestoreWindowValue((TxWindow) this, "DisplayGhostGun", ref obj2);
    copyAttachmentValue = new bool?(obj1 == null || Convert.ToBoolean(obj1));
    displayGhostGunValue = new bool?(obj2 == null || Convert.ToBoolean(obj2));
  }

  public void LoadOptionsData(
    out double? prismaticStepSizeValue,
    out double? revoluteStepSizeValue,
    out int? sliderSensitivityValue)
  {
    CUiRJJointsOptionsForm.LoadOptionsDataByWindowType(out prismaticStepSizeValue, out revoluteStepSizeValue, out sliderSensitivityValue);
  }

  public static void LoadOptionsDataByWindowType(
    out double? prismaticStepSizeValue,
    out double? revoluteStepSizeValue,
    out int? sliderSensitivityValue)
  {
    Type type = typeof (CUiRJJointsOptionsForm);
    object obj1;
    TxWindowSettings.RestoreWindowValue(type, "PrismaticStepSize", ref obj1);
    object obj2;
    TxWindowSettings.RestoreWindowValue(type, "RevoluteStepSize", ref obj2);
    object obj3;
    TxWindowSettings.RestoreWindowValue(type, "CustomSliderSensitivityValue", ref obj3);
    if (obj1 != null && obj2 != null && obj3 != null)
    {
      prismaticStepSizeValue = new double?(Convert.ToDouble(obj1));
      double? nullable = prismaticStepSizeValue;
      double num1 = 0.01;
      if (nullable.GetValueOrDefault() < num1 & nullable.HasValue)
      {
        prismaticStepSizeValue = new double?(0.01);
      }
      else
      {
        nullable = prismaticStepSizeValue;
        double num2 = 7.92281525142643E+18;
        if (nullable.GetValueOrDefault() > num2 & nullable.HasValue)
          prismaticStepSizeValue = new double?(7.92281525142643E+18);
      }
      revoluteStepSizeValue = new double?(Convert.ToDouble(obj2) * Math.PI / 180.0);
      nullable = revoluteStepSizeValue;
      double num3 = 0.00017453292519943296;
      if (nullable.GetValueOrDefault() < num3 & nullable.HasValue)
      {
        revoluteStepSizeValue = new double?(0.00017453292519943296);
      }
      else
      {
        nullable = revoluteStepSizeValue;
        double num4 = 4.0 * Math.PI;
        if (nullable.GetValueOrDefault() > num4 & nullable.HasValue)
          revoluteStepSizeValue = new double?(4.0 * Math.PI);
      }
      double num5 = Convert.ToDouble(obj3);
      sliderSensitivityValue = new int?(Convert.ToInt32(num5));
    }
    else
    {
      prismaticStepSizeValue = new double?();
      revoluteStepSizeValue = new double?();
      sliderSensitivityValue = new int?();
    }
  }

  private void StoreOptionsData(
    double prismaticStepSize,
    double revoluteStepSize,
    double customSliderSensitivityValue,
    bool copyAttachmentValue,
    object displayGhostGun)
  {
    TxWindowSettings.StoreWindowValue((TxWindow) this, "PrismaticStepSize", (object) prismaticStepSize);
    TxWindowSettings.StoreWindowValue((TxWindow) this, "RevoluteStepSize", (object) (revoluteStepSize * 180.0 / Math.PI));
    TxWindowSettings.StoreWindowValue((TxWindow) this, "CustomSliderSensitivityValue", (object) customSliderSensitivityValue);
    TxWindowSettings.StoreWindowValue((TxWindow) this, "CopyAttachmentValue", (object) copyAttachmentValue);
    TxWindowSettings.StoreWindowValue((TxWindow) this, "DisplayGhostGun", displayGhostGun);
  }

  private List<CUiRJJointsColumnData> GetColumnsSettingsFromUI()
  {
    List<CUiRJJointsColumnData> columnsSettingsFromUi = new List<CUiRJJointsColumnData>();
    for (int index = 0; index < this.gridColumns.RowDefinitions.Count; ++index)
    {
      CheckBox child1 = this.gridColumns.GetChild(index, 0, typeof (CheckBox)) as CheckBox;
      TextBox child2 = this.gridColumns.GetChild(index, 1, typeof (TextBox)) as TextBox;
      if (child1 != null && child2 != null)
      {
        CUiRJJointsColumnData jointsColumnData = new CUiRJJointsColumnData(this.gridColumns.RowDefinitions[index].Name, child2.Text)
        {
          Visible = child1.IsChecked.Value
        };
        columnsSettingsFromUi.Add(jointsColumnData);
      }
    }
    return columnsSettingsFromUi;
  }

  public static string SerializeColumns(List<CUiRJJointsColumnData> columnsData)
  {
    string str = "03";
    foreach (CUiRJJointsColumnData jointsColumnData in columnsData)
      str = $"{str}{jointsColumnData.SerializeData()}#";
    return str.TrimEnd('#');
  }

  public static List<CUiRJJointsColumnData> DeSerializeColumns(string columns)
  {
    List<CUiRJJointsColumnData> jointsColumnDataList = new List<CUiRJJointsColumnData>();
    string str1 = (string) null;
    string str2 = (string) null;
    if (columns != null)
    {
      string str3 = columns;
      str2 = str3.Substring(0, 2);
      str1 = str3.Remove(0, 2);
    }
    if (str1 != null && str2 == "03")
    {
      string str4 = str1;
      char[] chArray = new char[1]{ '#' };
      foreach (string serializedString in str4.Split(chArray))
        jointsColumnDataList.Add(CUiRJJointsColumnData.DeserializeString(serializedString));
    }
    else
    {
      jointsColumnDataList.Add(new CUiRJJointsColumnData(ColumnsIDS.Value, RJRobotJogResources.Joints_ValueColumnNiceName));
      jointsColumnDataList.Add(new CUiRJJointsColumnData(ColumnsIDS.Percentage, RJRobotJogResources.Joints_PercentageColumnNiceName, false));
      jointsColumnDataList.Add(new CUiRJJointsColumnData(ColumnsIDS.LowerLimit, RJRobotJogResources.Joints_LowerSoftLimitNiceName));
      jointsColumnDataList.Add(new CUiRJJointsColumnData(ColumnsIDS.UpperLimit, RJRobotJogResources.Joints_UpperSoftLimitNiceName));
    }
    return jointsColumnDataList;
  }

  private void OnCloseCmdExecuted(object sender, ExecutedRoutedEventArgs e)
  {
    ((Window) this).Close();
  }

  private void TxWindow_Loaded(object sender, RoutedEventArgs e)
  {
    this.RedrawGrid();
    ((Window) this).SizeToContent = SizeToContent.WidthAndHeight;
    ((FrameworkElement) this).MinHeight = ((FrameworkElement) this).ActualHeight;
    ((FrameworkElement) this).MaxHeight = ((FrameworkElement) this).ActualHeight;
    if (((FrameworkElement) this).ActualWidth <= ((FrameworkElement) this).MinWidth)
      return;
    ((FrameworkElement) this).MinWidth = ((FrameworkElement) this).ActualWidth;
  }

  private void OnRowFocus(object sender, RoutedEventArgs e)
  {
    this._selectedRow = Grid.GetRow(sender as UIElement);
    for (int row = 0; row < this.gridColumns.RowDefinitions.Count; ++row)
    {
      Border child1 = this.gridColumns.GetChild(row, 0, typeof (UIElement)) as Border;
      Border child2 = this.gridColumns.GetChild(row, 1, typeof (UIElement)) as Border;
      if (child1 != null && child2 != null)
      {
        child1.Background = (System.Windows.Media.Brush) null;
        child2.Background = (System.Windows.Media.Brush) null;
      }
    }
    Border child3 = this.gridColumns.GetChild(this._selectedRow, 0, typeof (UIElement)) as Border;
    Border child4 = this.gridColumns.GetChild(this._selectedRow, 1, typeof (UIElement)) as Border;
    if (child3 == null || child4 == null)
      return;
    child3.Background = TxStatusColor.ToBrush(TxStatusColor.Background("Emphasize1"));
    child4.Background = TxStatusColor.ToBrush(TxStatusColor.Background("Emphasize1"));
  }

  private void textBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
  {
    if (!(this.gridColumns.GetChild(this._selectedRow, 0, typeof (CheckBox)) is CheckBox child))
      return;
    CheckBox checkBox = child;
    bool? isChecked = child.IsChecked;
    bool? nullable = isChecked.HasValue ? new bool?(!isChecked.GetValueOrDefault()) : new bool?();
    checkBox.IsChecked = nullable;
  }

  private void sliderSensitivity_ValueChanged(
    object sender,
    RoutedPropertyChangedEventArgs<double> e)
  {
    this.sliderSensitivity.ToolTip = (object) Convert.ToInt32(this.sliderSensitivity.Value).ToString();
  }

  private void btnAccept_Click(object sender, RoutedEventArgs e)
  {
    double prismaticStepSize = this.numericUpDownPrismaticStepSize.Value;
    double revoluteStepSize = this.numericUpDownRevoluteStepSize.Value;
    double customSliderSensitivityValue = this.sliderSensitivity.Value;
    bool? isChecked = this.copyAttachmentCheckBox.IsChecked;
    bool flag1 = true;
    int num = isChecked.GetValueOrDefault() == flag1 & isChecked.HasValue ? 1 : 0;
    isChecked = this.displayGhostGunCheckBox.IsChecked;
    bool flag2 = true;
    // ISSUE: variable of a boxed type
    __Boxed<bool> displayGhostGun = (ValueType) (isChecked.GetValueOrDefault() == flag2 & isChecked.HasValue);
    this.StoreOptionsData(prismaticStepSize, revoluteStepSize, customSliderSensitivityValue, num != 0, (object) displayGhostGun);
    CApRJRobotJogUtilities.IsWeldLocationManipulationEnabled = this.ManipulateWeldRoboticLocations;
    CApRJRobotJogUtilities.IgnoreWeldOperationLocationLimitations = this.IgnoreWeldOperationLocationLimitations;
    CApRJRobotJogUtilities.IsSeamLocationManipulationEnabled = this.ManipulateSeamRoboticLocations;
    CApRJRobotJogUtilities.IgnoreSeamOperationLocationLimitations = this.IgnoreSeamOperationLocationLimitations;
    this.Columns = this.GetColumnsSettingsFromUI();
    this.PrismaticStepSize = Convert.ToDouble(this.numericUpDownPrismaticStepSize.Value);
    this.RevoluteStepSize = Convert.ToDouble(this.numericUpDownRevoluteStepSize.Value);
    this.CustomSliderSensitivity = Convert.ToInt32(this.sliderSensitivity.Value);
    ((Window) this).DialogResult = new bool?(true);
    ((Window) this).Close();
  }

  private void btnCancel_Click(object sender, RoutedEventArgs e) => ((Window) this).Close();

  private void btnUp_Click(object sender, RoutedEventArgs e)
  {
    if (this._selectedRow <= 0)
      return;
    this.gridColumns.SwapRows(this._selectedRow, this._selectedRow - 1);
    --this._selectedRow;
  }

  private void btnDown_Click(object sender, RoutedEventArgs e)
  {
    if (this._selectedRow + 1 >= this.gridColumns.RowDefinitions.Count)
      return;
    this.gridColumns.SwapRows(this._selectedRow, this._selectedRow + 1);
    ++this._selectedRow;
  }

  private void manipulateSeamRoboticLocationsCheckBox_Checked(object sender, RoutedEventArgs e)
  {
    this.ignoreSeamOperationLocationLimitationsCheckBox.IsEnabled = true;
  }

  private void DisableIgnoreSeamOperationLocationLimitationsCheckBox()
  {
    this.ignoreSeamOperationLocationLimitationsCheckBox.IsChecked = new bool?(false);
    this.ignoreSeamOperationLocationLimitationsCheckBox.IsEnabled = false;
  }

  private void manipulateSeamRoboticLocationsCheckBox_Unchecked(object sender, RoutedEventArgs e)
  {
    this.DisableIgnoreSeamOperationLocationLimitationsCheckBox();
  }

  private void manipulateWeldRoboticLocationsCheckBox_Checked(object sender, RoutedEventArgs e)
  {
    this.ignoreWeldOperationLocationLimitationsCheckBox.IsEnabled = true;
  }

  private void DisableIgnoreWeldOperationLocationLimitationsCheckBox()
  {
    this.ignoreWeldOperationLocationLimitationsCheckBox.IsChecked = new bool?(false);
    this.ignoreWeldOperationLocationLimitationsCheckBox.IsEnabled = false;
  }

  private void manipulateWeldRoboticLocationsCheckBox_Unchecked(object sender, RoutedEventArgs e)
  {
    this.DisableIgnoreWeldOperationLocationLimitationsCheckBox();
  }

  [DebuggerNonUserCode]
  [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  public void InitializeComponent()
  {
    if (this._contentLoaded)
      return;
    this._contentLoaded = true;
    Application.LoadComponent((object) this, new Uri("/DnProcessSimulateCommands;component/robotjog/controls/cuirjjointsoptionsform.xaml", UriKind.Relative));
  }

  [DebuggerNonUserCode]
  [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  [EditorBrowsable(EditorBrowsableState.Never)]
  void IComponentConnector.Connect(int connectionId, object target)
  {
    switch (connectionId)
    {
      case 1:
        ((FrameworkElement) target).Loaded += new RoutedEventHandler(this.TxWindow_Loaded);
        break;
      case 2:
        ((CommandBinding) target).Executed += new ExecutedRoutedEventHandler(this.OnCloseCmdExecuted);
        break;
      case 3:
        this.gridColumns = (Grid) target;
        break;
      case 4:
        this.buttonUp = (Button) target;
        this.buttonUp.Click += new RoutedEventHandler(this.btnUp_Click);
        break;
      case 5:
        this.btnUp_img = (System.Windows.Controls.Image) target;
        break;
      case 6:
        this.buttonDown = (Button) target;
        this.buttonDown.Click += new RoutedEventHandler(this.btnDown_Click);
        break;
      case 7:
        this.btnDown_img = (System.Windows.Controls.Image) target;
        break;
      case 8:
        this.prismaticJointsStepSizeUnits = (Label) target;
        break;
      case 9:
        this.revoluteJointsStepSizeUnits = (Label) target;
        break;
      case 10:
        this.numericUpDownPrismaticStepSize = (TxNumericEditBoxControl) target;
        break;
      case 11:
        this.numericUpDownRevoluteStepSize = (TxNumericEditBoxControl) target;
        break;
      case 12:
        this.sliderSensitivity = (Slider) target;
        this.sliderSensitivity.ValueChanged += new RoutedPropertyChangedEventHandler<double>(this.sliderSensitivity_ValueChanged);
        break;
      case 13:
        this.copyAttachmentCheckBox = (CheckBox) target;
        break;
      case 14:
        this.displayGhostGunCheckBox = (CheckBox) target;
        break;
      case 15:
        this.manipulateSeamRoboticLocationsCheckBox = (CheckBox) target;
        this.manipulateSeamRoboticLocationsCheckBox.Checked += new RoutedEventHandler(this.manipulateSeamRoboticLocationsCheckBox_Checked);
        this.manipulateSeamRoboticLocationsCheckBox.Unchecked += new RoutedEventHandler(this.manipulateSeamRoboticLocationsCheckBox_Unchecked);
        break;
      case 16 /*0x10*/:
        this.ignoreSeamOperationLocationLimitationsCheckBox = (CheckBox) target;
        break;
      case 17:
        this.manipulateWeldRoboticLocationsCheckBox = (CheckBox) target;
        this.manipulateWeldRoboticLocationsCheckBox.Checked += new RoutedEventHandler(this.manipulateWeldRoboticLocationsCheckBox_Checked);
        this.manipulateWeldRoboticLocationsCheckBox.Unchecked += new RoutedEventHandler(this.manipulateWeldRoboticLocationsCheckBox_Unchecked);
        break;
      case 18:
        this.ignoreWeldOperationLocationLimitationsCheckBox = (CheckBox) target;
        break;
      case 19:
        this.btnAccept = (Button) target;
        this.btnAccept.Click += new RoutedEventHandler(this.btnAccept_Click);
        break;
      case 20:
        this.btnCancel = (Button) target;
        this.btnCancel.Click += new RoutedEventHandler(this.btnCancel_Click);
        break;
      default:
        this._contentLoaded = true;
        break;
    }
  }
}
